{% extends "layout.html" %}
{% block body %}
<div class="am-container am-g">
    <h1>排名</h1>
    <form class="am-form-inline am-u-sm-8 " role="form" method="get" action="{{url_for('find_user')}}">
        <div class="am-form-group am-fl">
            <input type="text" class="am-form-field am-input-sm" name="nickname" placeholder="用户昵称">
        </div>
        <button type="submit" class="am-btn am-btn-primary am-input-sm am-fl">寻找用户</button>
    </form>
    <div class="am-u-sm-12">
	    <table class="am-table">
	        <thead>
	        <tr>
	            <th><center>排名</center></th>
	            <th><center>用户昵称</center></th>
	            <th>个性签名</th>
	            <th><center>通过数量</center></th>
	        </tr>
	        </thead>
	        <tbody>
	        {% set rank = sorter.per_page*(sorter.cur_page-1)+1%}
            {% set users = sorter.get() %}
	        {% for user in users%}
		        <tr>
		        	<td width = 50 align = "center" >{{rank}}</td> {%set rank=rank+1%}
		        	<td width = 100 align = "center" ><a href="{{url_for('user',user_id=user.id)}}">{{user.nickname}}</a>{% if user.nameplate %}{{user.nameplate|safe}}{% endif %}</td>
		        	<td>{% if user.information%}{{user.information}}{%endif%}</td>
		        	<td width = 80 align = "center" >{{user.ac_num}}</td>
		        </tr>
		     {% endfor %}
	        </tbody>
	    </table>
	</div>
    </hr>
    {{sorter.get_html()|safe}}
</div>
{%endblock%}
